home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / midas060 / include / midasdll.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1997-01-16  |  10.8 KB  |  267 lines

  1. {*      midasdll.pas
  2.  *
  3.  * MIDAS DLL programming interface Delphi interface unit
  4.  *
  5.  * $Id: midasdll.h,v 1.1 1996/09/25 18:38:12 pekangas Exp $
  6.  *
  7.  * Copyright 1996,1997 Housemarque Inc
  8.  *
  9.  * This file is part of the MIDAS Sound System, and may only be
  10.  * used, modified and distributed under the terms of the MIDAS
  11.  * Sound System license, LICENSE.TXT. By continuing to use,
  12.  * modify or distribute this file you indicate that you have
  13.  * read the license and understand and accept it fully.
  14. *}
  15.  
  16. unit midasdll;
  17.  
  18.  
  19. interface
  20.  
  21.  
  22. uses wintypes;
  23.  
  24.  
  25. const
  26.     { enum MIDASoptions }
  27.     MIDAS_OPTION_NONE = 0;
  28.     MIDAS_OPTION_MIXRATE = 1;
  29.     MIDAS_OPTION_OUTPUTMODE = 2;
  30.     MIDAS_OPTION_MIXBUFLEN = 3;
  31.     MIDAS_OPTION_MIXBUFBLOCKS = 4;
  32.  
  33.     { enum MIDASmodes }
  34.     MIDAS_MODE_NONE = 0;
  35.     MIDAS_MODE_MONO = 1;
  36.     MIDAS_MODE_STEREO = 2;
  37.     MIDAS_MODE_8BIT = 4;
  38.     MIDAS_MODE_16BIT = 8;
  39.     MIDAS_MODE_8BIT_MONO = MIDAS_MODE_8BIT or MIDAS_MODE_MONO;
  40.     MIDAS_MODE_8BIT_STEREO = MIDAS_MODE_8BIT or MIDAS_MODE_STEREO;
  41.     MIDAS_MODE_16BIT_MONO = MIDAS_MODE_16BIT or MIDAS_MODE_MONO;
  42.     MIDAS_MODE_16BIT_STEREO = MIDAS_MODE_16BIT or MIDAS_MODE_STEREO;
  43.  
  44.     { enum MIDASsampleTypes }
  45.     MIDAS_SAMPLE_NONE = 0;
  46.     MIDAS_SAMPLE_8BIT_MONO = 1;
  47.     MIDAS_SAMPLE_16BIT_MONO = 2;
  48.     MIDAS_SAMPLE_8BIT_STEREO = 3;
  49.     MIDAS_SAMPLE_16BIT_STEREO = 4;
  50.  
  51.     { enum MIDASloop }
  52.     MIDAS_LOOP_NO = 0;
  53.     MIDAS_LOOP_YES = 1;
  54.  
  55.     { enum MIDASpanning }
  56.     MIDAS_PAN_LEFT = -64;
  57.     MIDAS_PAN_MIDDLE = 0;
  58.     MIDAS_PAN_RIGHT = 64;
  59.     MIDAS_PAN_SURROUND = $80;
  60.  
  61.     { enum MIDASchannels }
  62.     MIDAS_CHANNEL_AUTO = $FFFF;
  63.  
  64.  
  65. type
  66.     MIDASmoduleInfo = record
  67.         songName : array[0..31] of char;
  68.         songLength : integer;
  69.         numPatterns : integer;
  70.         numInstruments : integer;
  71.         numChannels : integer;
  72.     end;
  73.     PMIDASmoduleInfo = ^MIDASmoduleInfo;
  74.  
  75.     MIDASinstrumentInfo = record
  76.         instName : array[0..31] of char;
  77.     end;
  78.     PMIDASinstrumentInfo = ^MIDASinstrumentInfo;
  79.  
  80.     MIDASplayStatus = record
  81.         position : dword;
  82.         pattern : dword;
  83.         row : dword;
  84.         syncInfo : integer;
  85.     end;
  86.     PMIDASplayStatus = ^MIDASplayStatus;
  87.  
  88.  
  89.     MIDASmodule = pointer;
  90.     MIDASsample = DWORD;
  91.     MIDASsamplePlayHandle = DWORD;
  92.     MIDASstreamHandle = pointer;
  93.     Pbyte = ^byte;
  94.  
  95.  
  96.  
  97. function MIDASgetLastError : integer; stdcall;
  98. function MIDASgetErrorMessage(errorCode : integer) : PChar; stdcall;
  99.  
  100. function MIDASstartup : boolean; stdcall;
  101. function MIDASinit : boolean; stdcall;
  102. function MIDASsetOption(option, value : integer) : boolean; stdcall;
  103. function MIDASclose : boolean; stdcall;
  104. function MIDASopenChannels(numChannels : integer) : boolean; stdcall;
  105. function MIDAScloseChannels : boolean; stdcall;
  106. function MIDASstartBackgroundPlay(pollRate : dword) : boolean; stdcall;
  107. function MIDASstopBackgroundPlay : boolean; stdcall;
  108. function MIDASpoll : boolean; stdcall;
  109. function MIDASgetVersionString : PChar; stdcall;
  110.  
  111. function MIDASloadModule(fileName : PChar) : MIDASmodule; stdcall;
  112. function MIDASplayModule(module : MIDASmodule; numEffectChannels : integer) :
  113.     boolean; stdcall;
  114. function MIDASstopModule(module : MIDASmodule) : boolean ; stdcall;
  115. function MIDASfreeModule(module : MIDASmodule) : boolean; stdcall;
  116.  
  117. function MIDASgetPlayStatus(status : PMIDASplayStatus) : boolean; stdcall;
  118. function MIDASsetPosition(newPosition : integer) : boolean; stdcall;
  119. function MIDASsetMusicVolume(volume : dword) : boolean; stdcall;
  120. function MIDASgetModuleInfo(module : MIDASmodule; info : PMIDASmoduleInfo) :
  121.     boolean; stdcall;
  122. function MIDASgetInstrumentInfo(module : MIDASmodule; instNum : integer;
  123.     info : PMIDASinstrumentInfo) : boolean; stdcall;
  124.  
  125. function MIDASloadRawSample(fileName : PChar; sampleType,
  126.     loopSample : integer) : MIDASsample; stdcall;
  127. function MIDASfreeSample(sample : MIDASsample) : boolean; stdcall;
  128. function MIDASsetAutoEffectChannels(firstChannel, numChannels : dword) :
  129.     boolean; stdcall;
  130. function MIDASplaySample(sample : MIDASsample; channel : dword;
  131.     priority : integer; rate, volume : dword; panning : integer) :
  132.     MIDASsamplePlayHandle;
  133.     stdcall;
  134. function MIDASstopSample(sample : MIDASsamplePlayHandle) : boolean; stdcall;
  135. function MIDASsetSampleRate(sample : MIDASsamplePlayHandle; rate : dword) :
  136.     boolean; stdcall;
  137. function MIDASsetSampleVolume(sample : MIDASsamplePlayHandle; volume : dword)
  138.     : boolean; stdcall;
  139. function MIDASsetSamplePanning(sample : MIDASsamplePlayHandle;
  140.     panning : integer) : boolean; stdcall;
  141. function MIDASsetSamplePriority(sample : MIDASsamplePlayHandle;
  142.     priority : integer) : boolean; stdcall;
  143.  
  144. function MIDASplayStreamFile(channel : dword; fileName : PChar;
  145.     sampleType : dword; sampleRate : dword; bufferLength : dword;
  146.     loopStream : integer) : MIDASstreamHandle; stdcall;
  147. function MIDASstopStream(stream : MIDASstreamHandle) : boolean; stdcall;
  148.  
  149. function MIDASplayStreamPolling(channel : dword; sampleType : dword;
  150.     sampleRate : dword; bufferLength : dword) : MIDASstreamHandle; stdcall;
  151. function MIDASfeedStreamData(stream : MIDASstreamHandle; data : Pbyte;
  152.     numBytes : dword; feedAll : boolean) : dword; stdcall;
  153.  
  154. function MIDASsetStreamRate(stream : MIDASstreamHandle; rate : dword)
  155.     : boolean; stdcall;
  156. function MIDASsetStreamVolume(stream : MIDASstreamHandle; volume : dword)
  157.     : boolean; stdcall;
  158. function MIDASsetStreamPanning(stream : MIDASstreamHandle; panning : integer)
  159.      : boolean; stdcall;
  160.  
  161.  
  162. implementation
  163.  
  164.  
  165.  
  166. function MIDASgetLastError : integer;
  167.     stdcall; external 'mds06rc1.dll' name '_MIDASgetLastError@0';
  168. function MIDASgetErrorMessage(errorCode : integer) : PChar;
  169.     stdcall; external 'mds06rc1.dll' name '_MIDASgetErrorMessage@4';
  170.  
  171. function MIDASstartup : boolean;
  172.     stdcall; external 'mds06rc1.dll' name '_MIDASstartup@0';
  173. function MIDASinit : boolean;
  174.     stdcall; external 'mds06rc1.dll' name '_MIDASinit@0';
  175. function MIDASsetOption(option, value : integer) : boolean;
  176.     stdcall; external 'mds06rc1.dll' name '_MIDASsetOption@8';
  177. function MIDASclose : boolean;
  178.     stdcall; external 'mds06rc1.dll' name '_MIDASclose@0';
  179. function MIDASopenChannels(numChannels : integer) : boolean;
  180.     stdcall; external 'mds06rc1.dll' name '_MIDASopenChannels@4';
  181. function MIDAScloseChannels : boolean;
  182.     stdcall; external 'mds06rc1.dll' name '_MIDAScloseChannels@4';
  183. function MIDASstartBackgroundPlay(pollRate : dword) : boolean;
  184.     stdcall; external 'mds06rc1.dll' name '_MIDASstartBackgroundPlay@4';
  185. function MIDASstopBackgroundPlay : boolean;
  186.     stdcall; external 'mds06rc1.dll' name '_MIDASstopBackgroundPlay@0';
  187. function MIDASpoll : boolean;
  188.     stdcall; external 'mds06rc1.dll' name '_MIDASpoll@0';
  189. function MIDASgetVersionString : PChar;
  190.     stdcall; external 'mds06rc1.dll' name '_MIDASgetVersionString@0';
  191.  
  192. function MIDASloadModule(fileName : PChar) : MIDASmodule;
  193.     stdcall; external 'mds06rc1.dll' name '_MIDASloadModule@4';
  194. function MIDASplayModule(module : MIDASmodule; numEffectChannels : integer) :
  195.     boolean;
  196.     stdcall; external 'mds06rc1.dll' name '_MIDASplayModule@8';
  197. function MIDASstopModule(module : MIDASmodule) : boolean ;
  198.     stdcall; external 'mds06rc1.dll' name '_MIDASstopModule@4';
  199. function MIDASfreeModule(module : MIDASmodule) : boolean;
  200.     stdcall; external 'mds06rc1.dll' name '_MIDASfreeModule@4';
  201.  
  202. function MIDASgetPlayStatus(status : PMIDASplayStatus) : boolean;
  203.     stdcall; external 'mds06rc1.dll' name '_MIDASgetPlayStatus@4';
  204. function MIDASsetPosition(newPosition : integer) : boolean;
  205.     stdcall; external 'mds06rc1.dll' name '_MIDASsetPosition@4';
  206. function MIDASsetMusicVolume(volume : dword) : boolean;
  207.     stdcall; external 'mds06rc1.dll' name '_MIDASsetMusicVolume@4';
  208. function MIDASgetModuleInfo(module : MIDASmodule; info : PMIDASmoduleInfo) :
  209.     boolean;
  210.     stdcall; external 'mds06rc1.dll' name '_MIDASgetModuleInfo@8';
  211. function MIDASgetInstrumentInfo(module : MIDASmodule; instNum : integer;
  212.     info : PMIDASinstrumentInfo) : boolean;
  213.     stdcall; external 'mds06rc1.dll' name '_MIDASgetInstrumentInfo@12';
  214.  
  215. function MIDASloadRawSample(fileName : PChar; sampleType,
  216.     loopSample : integer) : MIDASsample;
  217.     stdcall; external 'mds06rc1.dll' name '_MIDASloadRawSample@12';
  218. function MIDASfreeSample(sample : MIDASsample) : boolean;
  219.     stdcall; external 'mds06rc1.dll' name '_MIDASfreeSample@4';
  220. function MIDASsetAutoEffectChannels(firstChannel, numChannels : dword) :
  221.     boolean;
  222.     stdcall; external 'mds06rc1.dll' name '_MIDASsetAutoEffectChannels@8';
  223. function MIDASplaySample(sample : midasSample; channel : dword;
  224.     priority : integer; rate, volume : dword; panning : integer) :
  225.     MIDASsamplePlayHandle;
  226.     stdcall; external 'mds06rc1.dll' name '_MIDASplaySample@24';
  227. function MIDASstopSample(sample : MIDASsamplePlayHandle) : boolean;
  228.     stdcall; external 'mds06rc1.dll' name '_MIDASstopSample@4';
  229. function MIDASsetSampleRate(sample : MIDASsamplePlayHandle; rate : dword) :
  230.     boolean;
  231.     stdcall; external 'mds06rc1.dll' name '_MIDASsetSampleRate@8';
  232. function MIDASsetSampleVolume(sample : MIDASsamplePlayHandle; volume : dword)
  233.     : boolean;
  234.     stdcall; external 'mds06rc1.dll' name '_MIDASsetSampleVolume@8';
  235. function MIDASsetSamplePanning(sample : MIDASsamplePlayHandle;
  236.     panning : integer) : boolean;
  237.     stdcall; external 'mds06rc1.dll' name '_MIDASsetSamplePanning@8';
  238. function MIDASsetSamplePriority(sample : MIDASsamplePlayHandle;
  239.     priority : integer) : boolean;
  240.     stdcall; external 'mds06rc1.dll' name '_MIDASsetSamplePlayHandle@8';
  241.  
  242. function MIDASplayStreamFile(channel : dword; fileName : PChar;
  243.     sampleType : dword; sampleRate : dword; bufferLength : dword;
  244.     loopStream : integer) : MIDASstreamHandle;
  245.     stdcall; external 'mds06rc1.dll' name '_MIDASplayStreamFile@24';
  246. function MIDASstopStream(stream : MIDASstreamHandle) : boolean;
  247.     stdcall; external 'mds06rc1.dll' name '_MIDASstopStream@4';
  248.  
  249. function MIDASplayStreamPolling(channel : dword; sampleType : dword;
  250.     sampleRate : dword; bufferLength : dword) : MIDASstreamHandle;
  251.     stdcall; external 'mds06rc1.dll' name '_MIDASplayStreamPolling@16';
  252. function MIDASfeedStreamData(stream : MIDASstreamHandle; data : Pbyte;
  253.     numBytes : dword; feedAll : boolean) : dword;
  254.     stdcall; external 'mds06rc1.dll' name '_MIDASfeedStreamData@16';
  255.  
  256. function MIDASsetStreamRate(stream : MIDASstreamHandle; rate : dword)
  257.     : boolean;
  258.     stdcall; external 'mds06rc1.dll' name '_MIDASsetStreamRate@4';
  259. function MIDASsetStreamVolume(stream : MIDASstreamHandle; volume : dword)
  260.     : boolean;
  261.     stdcall; external 'mds06rc1.dll' name '_MIDASsetStreamVolume@4';
  262. function MIDASsetStreamPanning(stream : MIDASstreamHandle; panning : integer)
  263.      : boolean;
  264.      stdcall; external 'mds06rc1.dll' name '_MIDASsetStreamPanning@4';
  265.  
  266. BEGIN
  267. END.